export const getdata = ({url, method, data}) => {
		return new Promise((resolve, reject) => {
			uni.request({
				url: 'https://qjd.511lh.cn/api/mini_api' + url,
				data,
				method,
				header: {
					'Content-Type': 'application/x-www-form-urlencoded;charest=utf-8',
					'accept': '*/*',
					'token': uni.getStorageSync('accessToken'), //uni.setStorageSync('accessToken', 'hello')
				},
				success: (res) => {
					if(res.statusCode === 200){
						if(res.data.success){
							resolve(res.data.data)
						}else{
							if(res.data.code == 10004){
								uni.clearStorage();
								// this.$router.go(0);
							}else{
								resolve(res.data)
							}
							
						}
					}else if(res.statusCode === 400){
						uni.showToast({
							title:res.data.msg,
							icon: 'none'
						})
					}else{
						resolve(res)
					}
				},
				fail: (err) => {
					uni.hideLoading()
					reject(err)
				}
			})
		})
}